window.onload = function() {    
        
	
	$(function() {
		
		$(function() {
			var data = window.sessionStorage.getItem('myData');
		    if (!data) {
		        window.location = '../profile.html';
		    } else {
		    	data = JSON.parse(data);
		    	
		    	var url = 'http://ittalentsapi.bashibozuk.eu/game/game-start?user_id='+data.id+'&X-GameID=102';
		    	
		    	$.ajax(url, {
					method: 'GET',
					crossDomain : true,
					success: function(data) {
						
						var load = new Loader();
					    load.loadImgAndAudio(data.id);
					      
					}
				});	
		    }
		});
		
		
		
	})
    
};
